package com.vcredit.creditcat.manager.mobile;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.vcredit.creditcat.api.IMobileCallRecordCollectionManaager;
import com.vcredit.creditcat.model.CallLog;
import com.vcredit.creditcat.service.CallLogService;

@Service(protocol = { "protocol1" }, version = "1.0")
public class MobileCallRecordCollectionManaager implements IMobileCallRecordCollectionManaager {
	
	@Autowired
	private CallLogService callLogService;

	/**
	 * 保存通话记录
	 * 
	 * @param callLogDto
	 * @throws Exception
	 */
	@Override
	public void saveCallRecord(List<CallLog> callLogDto) throws Exception {
		for (CallLog callLog : callLogDto) {
			try{
				callLogService.insert(callLog);
			}catch(Exception e){
				continue;
			}
		}
	}

	/**
	 * 查询
	 * 
	 * @param param
	 * @return
	 * @throws Exception
	 */
	@Override
	public List<CallLog> findAllCallRecord(CallLog param) throws Exception {

		return callLogService.find(param);
	}
}
